package service.impl;

import dao.BookDao;
import dao.impl.BookDaoimpl;
import pojo.Book;
import service.BookService;

import java.util.Collections;
import java.util.List;

public class BookServiceimpl implements BookService {

    BookDao bookDao = new BookDaoimpl();

    @Override
    public List<Book> getAllBook() {
        return bookDao.getAllBook();
    }

    public void addBook(Book book) {
        bookDao.addBook(book);
    }

    @Override
    public void deleteBook(Integer bookid) {
        getBookid(bookid);
    }

    @Override
    public Book getBookid(Integer bookid) {
        return bookDao.getBoodid(String.valueOf(bookid));
    }


    @Override
    public void updateBook(Book book) {
        bookDao.updateBood(book);
    }

}
